<template>
  <div class="market-roll-wrap">
    <div class="market-roll-floors bg-white" v-for="(item,i) in list.list">
      <div class="market-roll-category fl">
        <h3>{{item.categoryTitle}}</h3>
        <div class="market-roll-ul">
          <a  v-for="(brand,i) in item.brandList" :href="brand.brandParamUrl" target="_blank">
            <img class="roll-img" :src="URL.PIC+brand.brandImgUrl"/>
          </a>
        </div>
        <div class="market-roll-label-item">
          <a  v-for="(tag,i) in item.tagList" :href="tag.forwardUrl" target="_blank">
            <span class="market-roll-a" >{{tag.categoryTagName}}</span>
          </a>
        </div>
      </div>
      <div class="market-roll-pd fl">
        <div class="market-roll-pdUL">
          <div class="market-roll-pdLi" v-for="(product,i) in item.productList">
            <a :href="URL.mall+'/product/'+ product.productId" target="_blank">
              <img :src="URL.PIC+product.productUrl" class="pdLi-img"/>
            </a>
            <p class="market-roll-pdTitle">{{product.productName}}</p>
            <div class="market-roll-pdPrice">￥{{product.productPrice}}</div>
          </div>
        </div>
      </div>
      
    </div>

  </div>
</template>

<script>

  import {getClassifyDetail} from '@/api/market'

  export default {
    name: 'rollWrap',
    props: ['marketId'],
    components: {

    },
    data() {
      return {
        list:[],
        categoryListQuery:{
          positionCode:'market_major',
          page:1,
          size:5,
          marketId:null
        }
      }
    },
    created() {
      this.categoryListQuery.marketId = this.marketId
      this.getClassifyDetail();
    },
    methods: {
      getClassifyDetail(){
        getClassifyDetail(this.categoryListQuery).then(res=>{
          this.list = res.data;
        });
      }
    }
  }
</script>

<style lang="scss" scoped>
.market-roll-wrap{
  .market-roll-floors{
    height: 308px;
    margin: 10px 0;
    border-radius: 10px;
  }
  
  .market-roll-category{
    width: 213px;
    height: 100%;
    background: #CDD4DA;
    text-align: center;
    border-radius: 10px 0 0 10px;
    h3{
      color: #333;
      font-size: 20px;
      margin: 40px auto;
    }
    .market-roll-ul{
      .roll-img{
        width: 84px;
        height: 40px;
        margin-right: 5px;
      }
    }
    .market-roll-label-item{
      padding: 0 20px;
      display: inline-block;
      margin-top: 20px;
      .market-roll-a{
        color: #888;
        font-size: 12px;
        margin: 0 5px;
        display: inline-block;
        line-height: 25px;
      }
    }
  }
  .market-roll-pd{
    .market-roll-pdUL{
      overflow: hidden;
      zoom: 1;
      padding: 0 10px;
      .market-roll-pdLi{
        float: left;
        width: 172px;
        cursor: pointer;
        margin: 30px 20px 0px;
        .pdLi-img{
          width: 170px;
          height: 170px;
          border: 1px solid #eee;
          border-radius: 10px;
        }
        .market-roll-pdTitle{
          display: -webkit-box;
          -webkit-box-orient: vertical;
          -webkit-line-clamp: 2;
          overflow: hidden;
          margin: 10px 0;
          font-size: 14px;
          color: #333;
          line-height: 20px;
          height: 40px;
          text-align: center;
        }
        .market-roll-pdTitle:hover{
          color: #255b8b;
        }
        .market-roll-pdPrice{
          color: #D0021B;
          text-align: center;
        }
      }
      .market-roll-pdLi:hover{
        .pdLi-img{
          -webkit-box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
          box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
        }
      }
    }
  }
  .market-roll-floors:first-child .market-roll-category{
    background: #CDD4DA;
  }
  .market-roll-floors:nth-child(2) .market-roll-category{
    background: #BAD0C8;
  }
  .market-roll-floors:nth-child(3) .market-roll-category{
    background: #D7D2C3;
  }
  .market-roll-floors:nth-child(4) .market-roll-category{
    background: #C7C9D7;
  }
}


</style>

